<template>
    <div>
        <!-- 面包屑 -->
        <el-bread></el-bread>
        <!-- 添加按钮 -->
        <el-button class="addbtn" type="primary" plain size="small" @click="Add">添加</el-button>
        <!-- 角色列表 -->
        <Rlist @isShow="edcancel"></Rlist>
        <!-- 弹框 -->
        <Rdialog ref="diaRef" :roleStatus="roleStatus" @cancel="cancel"></Rdialog>
    </div>
</template>
<script>
import Rlist from './Rlist.vue'
import Rdialog from './Rdialog.vue';
export default {
    data() {
        return {
            roleStatus:{
                 isShow:false,
                 isAdd:true
            }
           
        }
    },
    methods: {
        // 添加表单
        Add(){
            this.roleStatus.isShow = true
            this.roleStatus.isAdd = true
        },
        // 子传父 关闭弹框
        cancel(e){
            this.roleStatus.isShow = e
        },
        edcancel(id){
            this.roleStatus.isShow = true
            this.roleStatus.isAdd = false
            // 给弹框的lookup传一个id
            this.$refs.diaRef.lookup(id)
        }
    },
    mounted() { },
    computed: {},
    components: {Rlist,Rdialog}
}
</script>
<style scoped>
.addbtn {
    margin: 10px;
}
</style>